﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

//注意，这个是要用的
namespace 软构大作业
{
    public partial class Form5 : Form
    {
        public Form5()
        {
            InitializeComponent();
        }

        private new AutoAdaptWindowsSize AutoSize;
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x02000000;
                return cp;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if(Global.Instance.form6login==null)
            {
                Form6 form6 = new Form6();
                Global.Instance.form6login = form6;
            }
            Global.Instance.form6login.Show();
            Global.Instance.form5login.Hide();
           
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if(Global.Instance.form1login==null)
            {
                Form1 form1 = new Form1();
                Global.Instance.form1login = form1;
            }
            Global.Instance.form1login.Show();
            Global.Instance.form5login.Hide();
            
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void Form5_FormClosed(object sender, FormClosedEventArgs e)
        {
      
        }

        private void Form5_Load(object sender, EventArgs e)
        {
            AutoSize = new AutoAdaptWindowsSize(this);
            this.SizeChanged += new EventHandler(Form_SizeChanged);
        }
        private void Form_SizeChanged(object sender, EventArgs e)
        {//窗体大小改变事件
            if (AutoSize != null) // 一定加这个判断，电脑缩放布局不是100%的时候，会报错
            {
                AutoSize.FormSizeChanged();
            }
        }
    }
}
